package com.dengyuanke.wx.controller;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.dengyuanke.common.result.JsonResult;
import com.dengyuanke.entity.ServiceType;
import com.dengyuanke.service.IServiceTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 商品类型id 前端控制器
 * </p>
 *
 * @author dengyuanke
 * @since 2017-11-07
 */
@Api(tags = "服务类型相关API")
@RestController
public class ServiceTypeController {

    @Autowired
    private IServiceTypeService serviceTypeService;

    /**
     * 获得所有的服务类型
     * @return
     */
    @ApiOperation(value="获取所有服务类型")
    @PostMapping("/getallservicetype")
    public JsonResult getAllServiceType(){
        List<ServiceType> serviceTypes = serviceTypeService.selectList(new EntityWrapper<ServiceType>().eq("is_del", 0));
        return JsonResult.renderSuccess(serviceTypes);
    }

}
